[VMXASSIST] Fix data32/addr32 instruction decode issue.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 29 Sep 2006 10:11:49 +0000 (11:11 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 29 Sep 2006 10:11:49 +0000 (11:11 +0100)
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
tools/firmware/vmxassist/vm86.c

index 7581f3bfe5d1f8a20647233fc045c20532551b9c..d6cfb500e8448817459a560e08a7af6bb7f93700 100644 (file)
@@ -1412,12 +1412,14 @@ opcode(struct regs *regs)
                        {
                                int addr, data;
                                int seg = segment(prefix, regs, regs->vds);
+                               int offset = prefix & ADDR32? fetch32(regs) : fetch16(regs);
+
                                if (prefix & DATA32) {
-                                       addr = address(regs, seg, fetch32(regs));
+                                       addr = address(regs, seg, offset);
                                        data = read32(addr);
                                        setreg32(regs, 0, data);
                                } else {
-                                       addr = address(regs, seg, fetch16(regs));
+                                       addr = address(regs, seg, offset);
                                        data = read16(addr);
                                        setreg16(regs, 0, data);
                                }